<?php

/**
 * AuthController
 * 
 * @author Yury Patrin
 * @version 1.0
 */

class AuthController extends Zend_Controller_Action {
	public function indexAction() {
		$username = $this->_request->getPost('login');
		$password = $this->_request->getPost('password');
		
		$Users = new Application_Model_DbTable_Users();
		
		//Prepare page
		$this->view->headTitle('Мастерская Астролога :: Авторизация');
		
		if ($username) {
			if (!$User = $Users->login($username, $password)) {
				$this->view->ErrorMsg = "Неверный логин или пароль!";
			} else {
				var_dump($User);
				exit;
			}
		}
	}

}
